package com.ddyx.service.product.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 商品图片
 * </p>
 *
 * @author agula
 * @since 2019-08-06
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("p_goods_image")
public class GoodsImage extends Model<GoodsImage> {

    private static final long serialVersionUID=1L;

    /**
     * 图片ID
     */
    @TableId(value = "image_id", type = IdType.AUTO)
    private Integer imageId;

    /**
     * 商品ID
     */
    private Integer goodsId;

    /**
     * 图片URL
     */
    private String imageUrl;

    /**
     * 图片类型
     */
    private String imageType;

    /**
     * 图片编号
     */
    private Integer imageNo;

    /**
     * 是否主图
     */
    private Integer isHeadImage;

    /**
     * 创建时间
     */
    private LocalDateTime gmtCreate;

    /**
     * 修改时间
     */
    private LocalDateTime gmtModified;


    @Override
    protected Serializable pkVal() {
        return this.imageId;
    }

    @Override
    public String toString() {
        return "GoodsImage{" +
        "imageId=" + imageId +
        ", goodsId=" + goodsId +
        ", imageUrl=" + imageUrl +
        ", imageType=" + imageType +
        ", imageNo=" + imageNo +
        ", isHeadImage=" + isHeadImage +
        ", gmtCreate=" + gmtCreate +
        ", gmtModified=" + gmtModified +
        "}";
    }
}
